home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr42
/
smixc111.zip
/
SMIXC111.DOC
< prev
next >
Wrap
Text File
|
1995-02-15
|
7KB
|
133 lines
_____ __ __ ____ __ __ ______
/ _ \ | \ / | | | | \ / | / __ \
| / \__| | \/ | | | \ ~ / | / \__|
| \___ | | | | | | | |
\___ \ | /\/\ | | | | | | |
__ \ | | | | | | | | | | | _
| \_/ | | | | | | | / ^ \ | \___/ |
\_____/ |__| |__| |____| |__/ \__| \______/
Version 1.11
Written by Ethan Brodsky (2/15/95)
Copyright 1995 by Ethan Brodsky. All rights reserved.
This library is distributed AS IS. The author specifically disclaims
responsibility for any loss of profit or any consequential, incidental,
or other damages. SMIXC is freeware and is distributed with full Turbo
Pascal source code, which is copyright by Ethan Brodsky. You are free
to incorporate the code in full or part into your own programs as long
as credit is given to Ethan Brodsky. The source code may be distributed
in its original form only, including this documentation file.
------------------------------------------------------------------------
You may have used my SBVOX and SBDSP units. They both played one VOC
file at a time. The whole VOC file had to be loaded into conventional
memory, taking valuable memory from a real mode program.
SMIXC will play up to 8 sounds at one time. The sounds are stored in
extended memory and copied to a small buffer as needed. It should work
with any Sound Blaster compatible sound card. It uses auto-initialized
DMA if a SBPro or higher is installed, eliminating clicks between blocks.
On a SB16 is installed, it will use 16-bit sound output, increasing the
sound quality. Full Borland C source is included and it is identical in
functionality and implementation to the Turbo Pascal version.
The sounds are stored on disk as raw signed 8-bit sample data, at a
sampling rate of 22050 HZ. There are two options for usage of XMS:
1) Each sound can be stored in its own extended memory block. This
allows random allocation and deallocation of sounds. Each sound
uses an extended memory handle. The default HIMEM configuration
has only 32 handles, so the maximum number of sounds that can be
loaded is 32. (Less if TSRs or other drivers use handles) This
is the default mode.
2) All sounds can be loaded into one extended memory block. Sounds
can be loaded one at a time, but all sounds must be deallocated
at once. Initialize this mode by calling InitSharing before
allocating any sounds. Sounds should be allocated and freed as
usual by using the LoadSound and FreeSound procedures, but all
extended memory will remain allocated until ShutdownSharing is
called.
Please test test this on your setup (Especially if you have a Sound
Blaster compatible, a SB on IRQ10, or something out of the ordinary)
and report any imcompatibilities to me. I have reports that it worked
on sound cards including a ThunderBoard and a AWE32, and under Windows
NT 3.5 and OS/2 Warp.
As the block size is increased, the sound latency will also increase.
New sound effects are only started at the beginning of each block, so
a block size of 256 gives a latency of about 1/85 of a second. This
is the maximum time that can pass between when the StartSound procedure
is called and when the sound starts playing. A larger block size also
means that more conventional memory is needed for buffers. (7*BlockSize
bytes with 8-bit output, and 11*BlockSize with 16-bit output) I would
recommend a block size between 128 and 1024 bytes. In case you are
wondering about the three counters displayed by the test program, the
first one counts in the CPU's free time, the second counts the number of
interrupts that have occurred, and the third is the number of sounds
currently being played. If you have an incompatibility problem, please
tell me what each counter is doing.
This library will work in a real-mode IDE but requires a little work
to get it to work in the protected mode IDE. By default, the IDE's DPMI
extender uses all extended memory. The demo requires 190k of extended
memory, and any programs using SMIXC require extended memory to hold all
the sounds. You can decrease the amount of extended memory used by the
IDE by setting the DPMIMEM environment variable:
SET DPMIMEM=MAXMEM x
where x is the number of kilobytes of extended memory to use for the
IDE. You will have to find a balance between memory left over for your
program and memory available for IDE use. (Source code, online help,
compilation...) It is very important to deallocate extended memory on
program termination. The run-time library will free the heap, but extended
memory is left allocated. The handles and memory will be lost until the
next reboot. It is not enough just to deallocate XMS at the end of your
code, because a run-time error or exit() will stop execution before the
memory has been deallocated. I would recommend using an exit procedure
to deallocate memory, as demonstrated in the example program.
SMIXC uses a raw 8-bit unsigned file format. I have included a program
that will convert WAV files to the raw format necessary. The WAV files
must be 8-bit and sampled at 22050 HZ, or the output will be distorted.
I have several improvements planned, but I need feedback. If you are
using my code, I would greatly appreciate it if you would mail me and
tell me about it. If you have any bug reports, suggestions, or have
made improvements, please tell me! I also have finished a FM synthesis
MIDI music library and am working on a digital music library, so tell me
what you want!
This library is freeware, but I would appreciate contributions so I can
continue to buy development kits and upgrade my computer. You don't
NEED to send me anything, but if you are making of money by using this,
please send whatever you feel it is worth.
Features:
* Up to 8 sounds played simultaneously
* Sampling rate of 22050 HZ
* Autoinitialized DMA prevents clicking
* 16-bit sound output increases quality
* Mixes in the background using a fraction of CPU time
* Sounds stored in extended memory
------------------------------------------------------------------------
There are several ways to contact me:
E-Mail: ericbrodsky@psl.wisc.edu (Best)
Phone: (608) 238-4830
Mail:
Ethan Brodsky
4010 Cherokee Dr.
Madison, WI 53711
Bug fixes and other announcements will be posted in:
alt.sb.programmer
comp.sys.ibm.pc.soundcard.tech
rec.games.programmer
Up-to-date versions may be downloaded from:
x2ftp.oulu.fi /pub/msdos/programming/mxlibs/smix*.zip
(The directory structure there is currently being reorganized)
Revision history:
1.11 - Initial release corresponding with SMIX (Pascal) v1.11